package Servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class cancellation extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        resp.setContentType("text/html:charset=UTF-8");
        req.getSession().invalidate();
        if (req.getSession().getAttribute("username")==null){
            resp.sendRedirect("/login.jsp");
            System.out.println("注销了");
        }

    }
}
